package com.wlt.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wlt.mapper.SeckillGoodsMapper;
import com.wlt.pojo.SeckillGoods;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@DubboService
@Transactional
public class SeckillGoodsServiceImpl implements SeckillGoodsService
{
    @Autowired
    private SeckillGoodsMapper seckillGoodsMapper;
    
    @Override
    public void add (SeckillGoods seckillGoods)
    {
        seckillGoodsMapper.insert(seckillGoods);
    }
    
    @Override
    public void update (SeckillGoods seckillGoods)
    {
        seckillGoodsMapper.updateById(seckillGoods);
    }
    
    @Override
    public Page<SeckillGoods> findPage (int page, int size)
    {
        return seckillGoodsMapper.selectPage(new Page(page, size), null);
    }
}
